Repository navigation
[AIDAPP-1595]: Improve the user interface of advisories in the portal - #1561
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The portal endpoint never applies the new sorting logic, and the temporary feature flag lacks required cleanup tracking.
2 open findings
What changed in this PR
Adds advisory severity ranking infrastructure intended to improve portal ordering.
Changes:
- Adds sortable advisory severities with migration, observer, feature flag, and Filament reordering.
- Adds last-updated and severity-based portal sorting primitives.
- Adds ranking tests and advisory status factory states.
| File | Description |
|---|---|
app/Features/AdvisorySeveritySortFeature.php |
Gates severity sorting during deployment. |
app-modules/service-management/tests/Tenant/Observers/AdvisorySeverityObserverTest.php |
Tests automatic severity ranking. |
app-modules/service-management/tests/Tenant/Filament/Resources/AdvisorySeverities/Pages/ListAdvisorySeveritiesTest.php |
Tests listing and reordering behavior. |
app-modules/service-management/src/Observers/AdvisorySeverityObserver.php |
Assigns new severities the lowest rank. |
app-modules/service-management/src/Models/Scopes/WithLastUpdatedAt.php |
Selects each advisory’s latest update time. |
app-modules/service-management/src/Models/AdvisorySeverity.php |
Registers ranking support. |
app-modules/service-management/src/Models/Advisory.php |
Exposes the selected last-update timestamp. |
app-modules/service-management/src/Filament/Resources/AdvisorySeverities/Pages/ListAdvisorySeverities.php |
Enables drag-and-drop ranking. |
app-modules/service-management/database/migrations/2026_10_09_100457_add_sort_column_to_advisory_severities_table.php |
Adds and backfills severity ranks. |
app-modules/service-management/database/factories/AdvisoryStatusFactory.php |
Adds open and resolved factory states. |
app-modules/portal/src/Enums/AdvisorySort.php |
Defines severity-based portal ordering. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
danharrin
left a comment
There was a problem hiding this comment.
Between Status, Projects and Advisories, the portal now has a lot of local UI that other apps' portals will want too. Before this PR merges, I'd like to use it to tidy the components once:
Design system ground rules
- Use the themed utilities instead of arbitrary values. The portal's Tailwind preset already maps
rounded-sm/rounded/rounded-md/rounded-lgto the tenant's rounding setting, andbrand-*to the tenant's primary palette.- Write
rounded-lginstead ofrounded-[var(--rounding-lg)], which appears in about 18 files. - Write
brand-500instead ofrgba(var(--primary-500),1)orrgb(var(--primary-500)). These appear inAssetFilterTabs,ServiceMonitorDetailsCard,ServiceMonitorStatusCounts,ServiceMonitorUptimeCards,AssetStatCards,BaseSearchInput,BaseSelect,BaseTableSortableHeaderCelland the FormKit theme.
- Write
- Match the rounding scale to Filament's. At the tenant's default rounding, the themed scale already matches Filament exactly:
- Containers (cards, tables, empty states, the tabs bar):
rounded-lg, which is 0.75rem. - Controls (inputs, selects, buttons, tab items, pagination buttons):
rounded-md, which is 0.5rem. - Badges:
rounded, which is 0.375rem. - Never use
rounded-xlon a surface. It isn't themed, so it ignores the tenant's setting. Common'sPageCard,EmptyState,TabsandPaginationdo this today.
- Containers (cards, tables, empty states, the tabs bar):
- Use one surface style everywhere:
bg-white shadow-sm ring-1 ring-gray-950/5 rounded-lg. This matches Filament and the existing common components. The localborder border-gray-200 shadow-xsstyle should go. - Keep Tailwind classes out of domain files. Files like
serviceMonitorStatuses.jsandadvisoryPresentation.jsshould only map domain values to a tone or colour name, such asoperational → success. The components own the classes. The severity colour map and the badge colour fallbacks inadvisoryPresentation.jsshould disappear.
New components for canyongbs/common
BaseSection(like Filament's Section). Props:heading,description,icon; slots#actionsand default.- Replaces
BaseCardwith hand-written<h2>headers: advisory Description and Updates, and the uptime history card with its period select in#actions. - Also replaces the shell of
ServiceMonitorDetailsCard.
- Replaces
BaseTablefamily, moved fromComponents/ui:- The table container gets
#toolbarand#footerslots, so search and filters sit in the same surface as the rows andPaginationsits in the footer. This removes thePageCardwrappers that create a card inside a card on Projects, ViewProject and Advisories, and the-mx-6pagination hack on Advisories. - The header cell gets a
sortableprop, replacingBaseTableSortableHeaderCell. - The container gets a
loadingprop, replacing the hand-rolledopacity-60+aria-busywrappers on Status and Advisories. BaseTableCellTextuses CSSline-clampinstead of cutting text in JavaScript. Advisories then uses it too, instead of its own title and description markup.
- The table container gets
BaseSelect/BaseSearchInput/BaseInputError, moved fromComponents/ui:- Use Filament's input style:
ring-1 ring-gray-950/10 shadow-sm, with a brand focus ring. - Give
BaseSearchInputadebounceprop. Status and Advisories both duplicatewatch+setTimeouttoday. - Give
BaseInputErrorrole="alert".
- Use Filament's input style:
BaseCallout(one notice component). Props:tone(success / warning / danger / info / neutral),icon(defaults per tone),title,description,size(sm|lg); a#metaslot plus a smallBaseCalloutMetaitem.- Replaces
ServiceMonitorStatusBanner,ServiceMonitorStatusBannerMetaandServiceMonitorHealthNote, the inlinerole="note"box inViewProject, and the advisories summary banner. - The advisories page then no longer borrows service-monitor statuses (
degraded/operational).
- Replaces
BaseStatCard:label,value,icon. It replaces the hand-built cards insideServiceMonitorUptimeCards.AssetStatCardscan move to it later once it gains atone.
Changes to existing common components
Tabs:- Add a per-tab
badge(count), so Advisories shows "Active" with a count badge instead of "Active (4)", like Filament tabs. - Add an
idPrefixand full tab accessibility markup:tablist,tab,aria-selected,aria-controls.AssetFilterTabshas this today; commonTabsdoesn't. - Then delete
AssetFilterTabs. ThelabelandidPrefixprops and themb-0!override added to it in this PR go with it.
- Add a per-tab
BaseBadge:- Add
black,light-gray,dark-grayandnavy, so every case of theColorenum (which lives in common) works. - Add a
dotprop and switch to themedrounded. - Then delete
BaseStatusPill.ServiceMonitorStatusPillbecomesBaseBadgewith a colour from the status config. Advisory severity usesBaseBadgein both the list and the detail page; today it's a dot in one and a badge in the other.
- Add
EmptyState: make it the only empty state. Use:contained="false"inside tables and deleteBaseTableEmptyState, which draws a dashed box inside the card on Status, Projects and Advisories.PageCard,EmptyState,Tabs,Pagination: follow rule 2 for rounding.Pagination: it's already shaped as a table footer (border-t px-6 py-3), so use it only throughBaseTable's#footer.
Keep in the app
ServiceMonitorHistoryChart,ServiceMonitorHistorySparkline,ServiceMonitorStatusCounts,ProjectPipelineTableandAdvisoryUpdatesTimelineare domain-specific, so keep them local. Build them from the common pieces above and their status configs.- The timeline can move to common once a second page needs it.
Consistency across the three features
- One row action for every table: a "View" button in the last column, as
ProjectsTableandServiceMonitorsTablealready do. Advisories currently has a title link plus a chevron, which gives screen readers two links per row.
Suggested order
- Common PR first. Use the
local-common-developmentskill to link common locally. Add the rounding fixes, theTabs,BaseBadgeandEmptyStatechanges, and the newBaseSection,BaseTable*, inputs,BaseCalloutandBaseStatCard. Then we can release that. - This PR: bump common, then move Status, Projects and Advisories onto the shared components. Delete the local copies:
AssetFilterTabs,BaseTableEmptyState,BaseStatusPill,BaseCard,BaseTable*,BaseSelect,BaseSearchInputandBaseInputError. Then sweep the arbitrary rounding and colour values, including the FormKit theme.- Assets should come along wherever it uses the same components, since it shares the tabs, tables and empty states.
BaseDetailSectionandBaseListare only used on the service request page and can move toBaseSectionlater.
|
@danharrin |
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…dating tab structure
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…AdvisoryController
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d8b2a52 to
cc82007
Compare
…up rows Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…o their respondent Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e pagination Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nagement is available Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts: # app-modules/engagement/src/Filament/Actions/BulkDraftWithAiAction.php # app-modules/engagement/src/Filament/Actions/RelationManagerDraftWithAiAction.php # app-modules/knowledge-base/src/Filament/Resources/Actions/DraftKnowledgeBaseItemWithAiAction.php # app-modules/portal/tests/Tenant/Unit/AdvisoryApiTest.php # app-modules/project/tests/Tenant/Filament/Resources/ProjectResource/Pages/ViewProjectTest.php # app-modules/service-management/src/Filament/Resources/ServiceRequests/Pages/ViewServiceRequest.php # app-modules/service-management/tests/Tenant/Filament/Resources/Advisories/Pages/ListAdvisoriesTest.php # app-modules/service-management/tests/Tenant/Filament/Resources/ServiceRequests/Pages/ViewServiceRequestTest.php # app/Filament/Concerns/FiltersManagersFromGroups.php # app/Providers/Filament/AdminPanelProvider.php # app/Providers/Filament/LandlordPanelProvider.php
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>



Ticket(s) or GitHub Issue
Technical Description
sortcolumn, backfilled in creation order), behind a feature flag for zero-downtime deploys.canyongbs/commonto^2.45.0([AIDAPP-1595]: Improve the user interface of advisories in the portal common#172). Note: common 2.43+ adds Rector's type-declaration rules, soformat-dryrunnow flags existing code across the app.Any deployment steps required?
Cleanup Tasks
Before contributing and submitting this PR, make sure you have Read, agree, and are compliant with the contributing guidelines.